package com.kaussoft.lolblog.bo.impl;

import java.util.List;

import com.kaussoft.lolblog.bo.ServiceManager;
import com.kaussoft.lolblog.vo.Account;


public class ServiceManagerImpl extends BaseManagerImpl implements ServiceManager {

	@SuppressWarnings("unchecked")
	public List<Account> findAccounts(boolean lazy) {
		return getAccountDAO().loadAll(Account.class);
	}

	public Account findAccountsByName(String accountName, boolean lazy) {
		return getAccountDAO().findAccountsByName(accountName, lazy);
	}

	public List findWblogsByAccount(Account account) {
		return null;
	}

	public boolean removeAccount(Account account) {
		return false;
	}

	public boolean saveOrUpdateAccount(Account account) {
		try {
			getAccountDAO().saveOrUpdate(account);
		}
		catch (Exception e) {
			return false;
		}
		return true;
	}

	public boolean saveAccount(Account account) {
		try {
			getAccountDAO().save(account);
		}
		catch (Exception e) {
			return false;
		}
		return true;
	}

	public boolean updateAccount(Account account) {
		try {
			getAccountDAO().update(account);
		}
		catch (Exception e) {
			return false;
		}
		return true;
	}

}
